//
//  ShopHeaderView.m
//  FreeTrip
//
//  Created by 352324497@qq.com on 15/11/25.
//  Copyright © 2015年 邓芮. All rights reserved.
//

#import "ShopHeaderView.h"

@implementation ShopHeaderView

-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self)
    {
        CGFloat width = KScreenWidth - (10 * KScreenWidth / 375) * 2;
        self.travelEssentialsButton = [ShopButton buttonWithType:(UIButtonTypeCustom)];
        self.travelEssentialsButton.frame = CGRectMake(10 * KScreenWidth / 375, 10 * KScreenWidth / 375, width / 4, width * 3 / 8);
        [self.travelEssentialsButton.customImageView setImage:[UIImage imageNamed:@"travelEssentials"]];
        self.travelEssentialsButton.textLabel.text = @"出行必备";
        [self.contentView addSubview:_travelEssentialsButton];
        
        self.funTicketButton = [ShopButton buttonWithType:(UIButtonTypeCustom)];
        self.funTicketButton.frame = CGRectMake(10 * KScreenWidth / 375 + width / 4, 10 * KScreenWidth / 375, width / 4, width * 3 / 8);
        self.funTicketButton.customImageView.image = [UIImage imageNamed:@"FunTicket"];
        self.funTicketButton.textLabel.text = @"门票玩乐";
        [self.contentView addSubview:_funTicketButton];
        
        self.trafficButton = [ShopButton buttonWithType:(UIButtonTypeCustom)];
        self.trafficButton.frame = CGRectMake(10 * KScreenWidth / 375 + width / 4 * 2, 10 * KScreenWidth / 375, width / 4, width * 3 / 8);
        self.trafficButton.customImageView.image = [UIImage imageNamed:@"traffic"];
        self.trafficButton.textLabel.text = @"交通接驳";
        [self.contentView addSubview:_trafficButton];
        
        self.localPlansButton = [ShopButton buttonWithType:(UIButtonTypeCustom)];
        self.localPlansButton.frame = CGRectMake(10 * KScreenWidth / 375 + width / 4 * 3, 10 * KScreenWidth / 375, width / 4, width * 3 / 8);
        self.localPlansButton.customImageView.image = [UIImage imageNamed:@"localPlans"];
        self.localPlansButton.textLabel.text = @"当地行程";
        [self.contentView addSubview:_localPlansButton];
    }
    return self;
}

+(CGFloat)heightForHeader
{
    return (KScreenWidth - (10 * KScreenWidth / 375) * 2) * 3 / 8 - 50 * KScreenWidth / 375;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
